/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scaltblinescu")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scaltblinescu.findAll", query = "SELECT s FROM Scaltblinescu s"),
    @NamedQuery(name = "Scaltblinescu.findByScaltblinescuid", query = "SELECT s FROM Scaltblinescu s WHERE s.scaltblinescuid = :scaltblinescuid"),
    @NamedQuery(name = "Scaltblinescu.findByScittbescunid", query = "SELECT s FROM Scaltblinescu s WHERE s.scittbescunid = :scittbescunid")})
public class Scaltblinescu implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scaltblinescuid")
    private Integer scaltblinescuid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "scittbescunid")
    private int scittbescunid;
    @JoinColumn(name = "scaltblinescuid", referencedColumnName = "scittbescunid", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Scittbescun scittbescun;
    @JoinColumn(name = "scaltblineinveid", referencedColumnName = "scaltblineinveid")
    @ManyToOne(optional = false)
    private Scaltblineinve scaltblineinveid;

    public Scaltblinescu() {
    }

    public Scaltblinescu(Integer scaltblinescuid) {
        this.scaltblinescuid = scaltblinescuid;
    }

    public Scaltblinescu(Integer scaltblinescuid, int scittbescunid) {
        this.scaltblinescuid = scaltblinescuid;
        this.scittbescunid = scittbescunid;
    }

    public Integer getScaltblinescuid() {
        return scaltblinescuid;
    }

    public void setScaltblinescuid(Integer scaltblinescuid) {
        this.scaltblinescuid = scaltblinescuid;
    }

    public int getScittbescunid() {
        return scittbescunid;
    }

    public void setScittbescunid(int scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public Scittbescun getScittbescun() {
        return scittbescun;
    }

    public void setScittbescun(Scittbescun scittbescun) {
        this.scittbescun = scittbescun;
    }

    public Scaltblineinve getScaltblineinveid() {
        return scaltblineinveid;
    }

    public void setScaltblineinveid(Scaltblineinve scaltblineinveid) {
        this.scaltblineinveid = scaltblineinveid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scaltblinescuid != null ? scaltblinescuid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scaltblinescu)) {
            return false;
        }
        Scaltblinescu other = (Scaltblinescu) object;
        if ((this.scaltblinescuid == null && other.scaltblinescuid != null) || (this.scaltblinescuid != null && !this.scaltblinescuid.equals(other.scaltblinescuid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scaltblinescu[ scaltblinescuid=" + scaltblinescuid + " ]";
    }
    
}
